package com.llt.user.entity;

import com.baomidou.mybatisplus.annotation.*;

import java.beans.Transient;
import java.io.Serializable;

import com.fasterxml.jackson.annotation.JsonProperty;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;

import javax.validation.constraints.NotBlank;

/**
 * <p>
 * 
 * </p>
 *
 * @author llt
 * @since 2020-12-10
 */
@ApiModel(value="User对象", description="")
public class User implements Serializable {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "用户id")
    @TableId(value = "user_id", type = IdType.ASSIGN_UUID)
    private String userId;

    @ApiModelProperty(value = "逻辑删除",hidden = true)
    @JsonProperty(access = JsonProperty.Access.WRITE_ONLY)//序列化不返回前端
    @TableLogic
    private Integer isDelete;

    @ApiModelProperty(value = "乐观锁",hidden = true)
    @JsonProperty(access = JsonProperty.Access.WRITE_ONLY)//序列化不返回前端
    @Version
    private Integer version;

    @ApiModelProperty(value = "用户名")
    private String username;

    @ApiModelProperty(value = "密码")
    @JsonProperty(access = JsonProperty.Access.WRITE_ONLY)//序列化不返回前端
    private String password;

    @ApiModelProperty(value = "邮箱")
    @NotBlank(message = "邮箱不能为空")
    private String email;

    @ApiModelProperty(value = "1 男 0 女")
    private Integer sex;

    @ApiModelProperty(value = "年龄")
    private Long age;

    @ApiModelProperty(value = "职业")
    private String job;

    @ApiModelProperty(value = "手机号移动端")
    private String mobile;

    @ApiModelProperty(value = "地址")
    private String address;
    @ApiModelProperty(value = "验证码")
    //映射数据库忽略的字段
    @TableField(exist = false)
    private String code;
    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public String getUserId() {
        return userId;
    }

    public void setUserId(String userId) {
        this.userId = userId;
    }



    public Integer getIsDelete() {
        return isDelete;
    }

    public void setIsDelete(Integer isDelete) {
        this.isDelete = isDelete;
    }

    public Integer getVersion() {
        return version;
    }

    public void setVersion(Integer version) {
        this.version = version;
    }

    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public String getEmail() {
        return email;
    }

    public void setEmail(String email) {
        this.email = email;
    }

    public Integer getSex() {
        return sex;
    }

    public void setSex(Integer sex) {
        this.sex = sex;
    }

    public Long getAge() {
        return age;
    }

    public void setAge(Long age) {
        this.age = age;
    }

    public String getJob() {
        return job;
    }

    public void setJob(String job) {
        this.job = job;
    }

    public String getMobile() {
        return mobile;
    }

    public void setMobile(String mobile) {
        this.mobile = mobile;
    }

    public String getAddress() {
        return address;
    }

    public void setAddress(String address) {
        this.address = address;
    }

    @Override
    public String toString() {
        return "User{" +
        "userId=" + userId +
        ", isDelete=" + isDelete +
        ", version=" + version +
        ", username=" + username +
        ", password=" + password +
        ", email=" + email +
        ", sex=" + sex +
        ", age=" + age +
        ", job=" + job +
        ", mobile=" + mobile +
        ", address=" + address +
        "}";
    }
}
